home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
emulator
/
bsvc-1.000
/
bsvc-1
/
bsvc-1.0.4
/
src
/
SimHector
/
cpu
/
RegisterSet.cxx
< prev
next >
Wrap
C/C++ Source or Header
|
1995-07-26
|
2KB
|
58 lines
///////////////////////////////////////////////////////////////////////////////
//
// RegisterSet.cxx - The Hector 1600's Register Set
//
// By: Bradford W. Mott
// December 3,1993
//
///////////////////////////////////////////////////////////////////////////////
#include "RegisterSet.hxx"
///////////////////////////////////////////////////////////////////////////////
// Array of register information (User Registers Only)
///////////////////////////////////////////////////////////////////////////////
RegisterData RegisterSet::register_data[] = {
{"R0", "General purpose register 0"},
{"R1", "General purpose register 1"},
{"R2", "General purpose register 2"},
{"R3", "General purpose register 3"},
{"R4", "General purpose register 4"},
{"R5", "General purpose register 5"},
{"R6", "General purpose register 6"},
{"R7", "General purpose register 7"},
{"R8", "General purpose register 8"},
{"R9", "General purpose register 9"},
{"R10", "General purpose register 10"},
{"R11", "Software Interrupt Vector"},
{"R12", "Non-maskable Interrupt Vector"},
{"R13", "Maskable Interrupt Vector"},
{"SP", "Stack Pointer"},
{"PC", "Program Counter"}
};
///////////////////////////////////////////////////////////////////////////////
// The Constructor
///////////////////////////////////////////////////////////////////////////////
RegisterSet::RegisterSet()
: number_of_user_registers(sizeof(register_data)/sizeof(RegisterData)),
number_of_registers(sizeof(register_data)/sizeof(RegisterData)+2)
{
// Allocate array for register values
register_value=new unsigned long[number_of_registers];
// Clear all of the registers
for(int t=0;t<number_of_registers;++t)
register_value[t]=0;
}
///////////////////////////////////////////////////////////////////////////////
// The Destructor
///////////////////////////////////////////////////////////////////////////////
RegisterSet::~RegisterSet()
{
// Deallocate the register value array;
delete[] register_value;
}